<?php

/**
 * user_account form base class.
 *
 * @method user_account getObject() Returns the current form's model object
 *
 * @package    sf_sandbox
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class Baseuser_accountForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'             => new sfWidgetFormInputHidden(),
      'user_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('User'), 'add_empty' => true)),
      'plan_id'        => new sfWidgetFormInputText(),
      'balance'        => new sfWidgetFormInputText(),
      'account_status' => new sfWidgetFormInputText(),
      'payment_term'   => new sfWidgetFormInputText(),
      'recurring_id'   => new sfWidgetFormInputText(),
      'created_at'     => new sfWidgetFormDateTime(),
      'updated_at'     => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'             => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'user_id'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('User'), 'required' => false)),
      'plan_id'        => new sfValidatorInteger(array('required' => false)),
      'balance'        => new sfValidatorNumber(array('required' => false)),
      'account_status' => new sfValidatorInteger(array('required' => false)),
      'payment_term'   => new sfValidatorInteger(array('required' => false)),
      'recurring_id'   => new sfValidatorPass(array('required' => false)),
      'created_at'     => new sfValidatorDateTime(),
      'updated_at'     => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('user_account[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'user_account';
  }

}
